package com.itheima.variableparameter;

public class VariableParameterDemo3 {
    public static void main(String[] args) {
//        int[] arr = {1, 2, 3, 4, 5};
//        System.out.println(arr);
        int sum = getSum(1, 2, 3, 4, 5);
        System.out.println(sum);
    }

    private static int getSum(int number, int...arr) {
        int sum = 0;
        for (int i : arr) {
            sum += i;
        }
        return sum;
    }
}
